<div id="blogs">
	<ul class="bloghead">
		<li class="li1">文章列表</li>
		<li class="li2"><a href="blog.php">写新文章</a></li>
	</ul>
<?php
if (!empty($blogs)){
	$i=0;
	if($page->blogKind){
		$blogKind=$page->getBlogKindById($page->blogKind);
		echo "<div class='blogKindHead'>在<b>".($blogKind[0]['content'])."</b>分类下的博客</div>";
	}
	//display blogs
	foreach ($blogs as $key=>$values){
		$blogId=$values[0];
		echo "<div class='blogiterm' id ='blogId$blogId'>";//start one blog
		echo "<h2><img src='style/fam_page_white.gif' /> <a href='bloglist.php?blogId=$blogId'>".$values["title"]."</a></h2>";
		$blogUser = $usernumbers[$i];
		echo "<div class='blogtime'>$blogUser&nbsp;&nbsp;".$values['postTime']."</div>";
		$content = $values["content"];
		//display first sevaral parts of the blog when $oneBlog is false
		$content = $page->getBlogShortCut($content,600);
		echo "<div class='blogtext'>$content</div>";
		//display the entrance of the whole blog
		echo "<div class ='readwholeBlog'><a href='bloglist.php?blogId=$blogId'>阅读全文>></a></div>";
		//get this blog kind
		$tKind =$kinds[$i];
		$i++;
		$managdata ="&nbsp;&nbsp;|&nbsp;&nbsp;<a href='blog.php?blogId=$blogId'>编辑</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick =blogDelete('$blogId') class='blogdeletebutton'>删除</a>";
		$blogNumbers = $page->getKindBlogNumbers($tKind);
		$tKindId =$page->getBlogKindContent($tKind);
		if (!$profileID){
			$modiPro = 1;
			$profileID = $page->getBlogOwner($blogId);
		}
		
		echo "<div class='blogmanagediv'>类别&nbsp;:&nbsp;&nbsp;<a href=bloglist.php?userId=$profileID&blogKind=$tKindId>".$tKind."</a>（".$blogNumbers."）";
		if($modiPro){
			$profileID = "";
		}
		$blogOwnerId = $values["userId"];
		if($blogOwnerId==$userId){
			echo $managdata;
		}
		echo "&nbsp;&nbsp;|&nbsp;&nbsp;<a href='bloglist.php?blogId=$blogId'>浏览（$values[view]）</a></div>";
		echo "</div>";//end one blog
	}
	$page->blogPageList("blog");
}else{
	echo "博客家园";
}
?>
</div><!--end blogs--->

<div id="rightpart">
<?php
if ($profileID!=""){
	echo "<h2>文章分类</h2>";
	
	if(!empty($blogKindList)){
		/* if it is viewed by blog owner,display the control button */
		if($profileID==$userId){
			echo "<div class='blogkindconroldivhead'><img src='style/grouped_to_order_icon.png' style='height:14px' /> <a href='#' class='blogkindconrolbutton'>管理</a></div>";
		}else{
			echo "<div class='blogkindconroldivhead'></div>";
		}
		echo '<ul class="blogKindList">';
		/* display the blog kind list*/
		foreach ($blogKindList as $key=>$values){
			$blogNumbers = $page->getKindBlogNumbers($values[1]);
			echo "<li><span class='kindText'><a href='bloglist.php?userId=$profileID&blogKind=$values[0]'>$values[1]"."</a>（".$blogNumbers."）</span>";
			if($profileID==$userId){
				echo"<input type='text' value='编辑' class='kindlisteditor' onfocus=blogKindListFocus(this) onblur=blogKindListEditor('$values[0]',this) />&nbsp;&nbsp;&nbsp;<a onclick=blogKindListDelete(this,'$values[0]') class='blogDelteS'>删除</a>";
			}
				echo "</li>";
		}
		echo "</ul>";
	}else {
		echo "还没有分类";
	}
	
}
	?>
</div><!--end right part--->